package com.ctshk.app.system.controller;

import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.dto.Result;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.common.web.support.BaseController;
import com.ctshk.rpc.system.req.MainDataCollectionTypeDetailReq;
import com.ctshk.rpc.system.req.MainDataCollectionTypeListReq;
import com.ctshk.rpc.system.service.IMainDataCollectionTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 收款类型 前端控制器
 * </p>
 *
 * @author 谢诗宏
 * @since 2021-03-09
 */
@Api(value="收款類型", tags="收款類型")
@RestController
@RequestMapping("/main/data/collection/type")
public class MainDataCollectionTypeController extends BaseController {

    @DubboReference
    private IMainDataCollectionTypeService iMainDataCollectionTypeService;

    @ApiOperation(value = "列表", notes = "列表")
    @OperationLogAnnotation(operModul = OperationLogModel.ORDER, operType = OperationLogType.QUERY, operTitle = "列表", operDesc = "列表")
    @PostMapping("/list")
    public Result list(@RequestBody MainDataCollectionTypeListReq req) {
        return iMainDataCollectionTypeService.list(req, getCurrentUser(getRequest()));
    }

    @ApiOperation(value = "详情", notes = "详情")
    @OperationLogAnnotation(operModul = OperationLogModel.ORDER, operType = OperationLogType.QUERY, operTitle = "详情", operDesc = "详情")
    @PostMapping("/detail")
    public Result detail(@RequestBody MainDataCollectionTypeDetailReq req) {
        return iMainDataCollectionTypeService.detail(req, getCurrentUser(getRequest()));
    }
}
